//package com.core.androidlearndemo.permission;
//
//import android.Manifest;
//import android.content.DialogInterface;
//import android.os.Bundle;
//import android.support.annotation.NonNull;
//import android.support.v7.app.AlertDialog;
//import android.support.v7.app.AppCompatActivity;
//import android.util.Log;
//import android.view.View;
//
//import com.core.androidlearndemo.MainActivity;
//import com.core.androidlearndemo.R;
//
//public class PermissionActivity extends AppCompatActivity {
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_permission);
//        findViewById(R.id.text).setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
////                CCResult result = CC.obtainBuilder("ComponentA")
////                        .setActionName("showActivity")
////                        .build()
////                        .call();
//                PermissionManager.request(PermissionActivity.this, new String[]{Manifest.permission.CAMERA});
////                callPhone();
//            }
//        });
//
//    }
//
//    //需要获取权限
//    @NeedsPermission
//    public void callPhone() {
//        Log.d("11111", "NeedsPermission");
//    }
//
//    @OnPermissionDenied
//    public void deniedCallPhone() {
//        Log.d("11111", "deniedCallPhone");
//        new AlertDialog.Builder(PermissionActivity.this).setTitle("拒绝访问").setNegativeButton("取消", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialog, int which) {
//
//            }
//        }).setPositiveButton("确认", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialog, int which) {
//            }
//        }).show();
//    }
//
//    @OnNeverAskAgain
//    public void neverCallPhone(final PermissionSetting request) {
//        Log.d("11111", "neverCallPhone");
//        new AlertDialog.Builder(MainActivity.this).setTitle("拒绝访问").setNegativeButton("取消", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialog, int which) {
//
//            }
//        }).setPositiveButton("确认", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialog, int which) {
//                request.setting(666);
//            }
//        }).show();
//    }
//
//    @OnShowRationale
//    public void showRationaleCallPhone(final PermissionRequest request) {
//        Log.d("11111", "showRationaleCallPhone");
//        new AlertDialog.Builder(PermissionActivity.this).setTitle("拒绝访问").setNegativeButton("取消", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialog, int which) {
//
//            }
//        }).setPositiveButton("确认", new DialogInterface.OnClickListener() {
//            @Override
//            public void onClick(DialogInterface dialog, int which) {
//                request.proceed();
//            }
//        }).show();
//    }
//
//    @Override
//    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
//        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
//        PermissionManager.onRequestPermissionsResult(this,requestCode,grantResults);
//    }
//}
